import { defineStore } from 'pinia'

export const useAppStore = defineStore('app', {
  state: () => ({
    sidebar: {
      opened: true,
    },
  }),
  actions: {
    resetState() {
      this.$reset()
    },
    toggleSideBar() {
      this.sidebar.opened = !this.sidebar.opened
    },
  },
  persist: {
    storage: window.localStorage,
  },
})
